using UnityEngine;
using QFramework;

namespace survivor
{
	public partial class Enemy : ViewController
	{
		public float moveSpeed = 2.0f;

        public float HP = 3f;

        private void Update()
        {
            if (Player.ins)
            {
                var direction = (Player.ins.transform.position - transform.position).normalized;
                 
                transform.Translate(direction * Time.deltaTime * moveSpeed);
            }

            if (HP <= 0)
            {
                //UIKit.OpenPanel<UIGamePassPanel>();
                this.DestroyGameObjGracefully();
                Global.Exp.Value++;
            }
        }
    }
}
